public class LinearSearch 
{
	Comparable[] arr;
	int n;
	public LinearSearch(Comparable[] arr) 
	{
		this.arr = arr;
	}

	public int search(Comparable key) 
	{
		n = 0;
		for (Comparable c : arr) 
		{
			n++;
			if (c.compareTo(key) == 0)
				return n;
		}
		return n;
	}
}
